package com.oa.gform.client.ui.datasource;
import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.Command;
import com.oa.gform.client.ui.datamodel.GDataSourceParam;

/***
 * Classe base da cui estendono i datasource tipizzati.
 * 
 * La classe persiste nel dataList la lista dei dati attualemente 
 * presenti nel datasource. 
 * @author Marco
 *
 * @param <BeanType>
 */

public abstract class GDataSourceImpl<BeanType> implements GDataSource<BeanType> {

	public List<BeanType>  data = new ArrayList<BeanType>();

	public List<BeanType> getData() {
		return data;
	}

	boolean cacheEnabled = false;
	
	public boolean isCacheEnabled() {
		return cacheEnabled;
	}

	public void setCacheEnabled(boolean cacheEnabled) {
		this.cacheEnabled = cacheEnabled;
	}
	
	@Override
	public void loadData() {
		//this.loadData(null);
	}
	
	@Override
	public void loadData(Command callback) {
		//this.loadData(null, callback);
	}
	
	
	@Override
	public void loadData(GDataSourceParam param, Command callback) {
		//this.loadData(param, callback);
	}
	

	public void loadData(GDataSourceParam param) {
		//this.loadData(param);
	}
	

}
